cmake_minimum_required(VERSION 3.16)
#注意，设置新的project会覆盖 PROJECT_SOURCE_DIR
project(sdr_deepdetect VERSION 1.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
	include_directories($ENV{UHD_PKG_PATH}/include)
	link_directories($ENV{UHD_PKG_PATH}/lib)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
	message(${PROJECT_SOURCE_DIR})
	include_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/fftw)
	if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
		link_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/fftw/x64)
		set (FFT_LIB fftw3-3)
	else()
		link_directories(${PROJECT_SOURCE_DIR}/../3rdlibs/fftw/)
		set (FFT_LIB fftw3-3)
	endif()
else()
	set (FFT_LIB fftw3)
endif()


#############Target======================

add_executable(sdd_emitter
	waveform.cpp
	waveform.h
	sdd_emitter/main.cpp
)
target_link_libraries(sdd_emitter 
	Qt${QT_VERSION_MAJOR}::Core
	uhd
)

add_executable(sdd_reciever
	waveform.cpp
	waveform.h
	sdd_reciever/main.cpp
)
target_link_libraries(sdd_reciever 
	Qt${QT_VERSION_MAJOR}::Core
	uhd
	${FFT_LIB}
)
